package com.yuanfeng.job.mapper;

import com.yuanfeng.commoms.dto.job.ShopSettleAccountInfoDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @ClassName SettleAccountsMapper
 * @Description 账号
 * @Author liulh
 * @Date 2023/5/17 16:24
 * @Version 1.0
 **/
@Mapper
public interface SettleAccountsMapper {

    /**
     * 获取Beform日期
     *
     * @param shopId
     * @param osOrderType
     * @return
     */
    String getBeformDate(@Param("shopId") String shopId, @Param("osOrderType") Integer osOrderType);

    /**
     * 获取结算账户订单
     *
     * @param paraMap
     * @return
     */
    ShopSettleAccountInfoDTO getSettleAccountOrder(Map<String, String> paraMap);

    /**
     * 获取结算账户返回
     *
     * @param paraMap
     * @return
     */
    ShopSettleAccountInfoDTO getSettleAccountReturn(Map<String, String> paraMap);

    /**
     * 按商店ID获取金额
     *
     * @param shopId
     * @return
     */
    Double getFineMoneyByShopId(String shopId);

    /**
     * 新增结算
     *
     * @param paraMap
     * @return
     */
    Integer insertSettlement(Map<String, String> paraMap);

    /**
     * 更新店铺投诉基础
     *
     * @param paraMap
     * @return
     */
    Integer updateShopComplainBase(Map<String, String> paraMap);

    /**
     * 更新订单基础结算
     *
     * @param paraMap
     * @return
     */
    Integer updateOrderBaseSettlement(Map<String, String> paraMap);

    /**
     * 更新订单退货结算
     *
     * @param paraMap
     * @return
     */
    Integer updateOrderReturnSettlement(Map<String, String> paraMap);

    /**
     * 获取结算账户订单Id
     *
     * @param getMap
     * @return
     */
    List<String> getSettleAccountOrderId(Map<String, String> getMap);

    /**
     * 获取结算账户退单订单Id
     *
     * @param getMap
     * @return
     */
    List<String> getSettleAccountReturnId(Map<String, String> getMap);

    /**
     * 更新结算
     *
     * @param orderIds
     * @param osId
     * @return
     */
    Integer updateOrderBaseSettlement2(@Param("orderIds") List<String> orderIds, @Param("osId") String osId);

    /**
     * 更新结算
     *
     * @param orderIds
     * @param osId
     * @return
     */
    Integer updateOrderReturnSettlement2(@Param("orderIds") List<String> orderIds, @Param("osId") String osId);

    /**
     * 更新店铺的结算时间
     *
     * @param shopId
     */
    void updateShopSettlement(String shopId);


    ShopSettleAccountInfoDTO getDealerSettleAccountOrder(@Param("paraMap") Map<String, String> paraMap);


    ShopSettleAccountInfoDTO getDealerSettleAccountReturn(@Param("paraMap")Map<String, String> paraMap);

    /**
     * 一键上架商品供应商订单结算统计
     * @param paraMap
     * @return
     */
    ShopSettleAccountInfoDTO getSupplySettleAccountOrder(@Param("param") Map<String, String> paraMap);

    /**
     * 一键上架商品供应商退单结算统计
     * @param paraMap
     * @return
     */
    ShopSettleAccountInfoDTO getSupplySettleAccountReturn(@Param("param") Map<String, String> paraMap);

    /**
     *查询需要更新的退款订单集合
     * @param paraMap
     * @return
     */
    List<String> querySupplyOrderBaseInfo(@Param("param") Map<String, String> paraMap);


    Integer updateSupplyOrderBaseSettlement(@Param("param")Map<String, Object> paraMap);


    Integer updateSupplyOrderReturnSettlement(@Param("param")Map<String, Object> paraMap);
}
